
use rbatis::rbatis::Rbatis;
use rbatis::core::db::DBPoolOptions;
use crate::extends::config::CONFIG;
//初始化
pub async fn init_rbatis() {
    let mut opt = DBPoolOptions::new();
    opt.max_connections = 20;
    RB.link_opt(&format!(
        
        "mysql://{}:{}@{}:{}/{}",
        &CONFIG.db.username ,
        &CONFIG.db.password ,
        &CONFIG.db.host ,
        &CONFIG.db.port ,
        &CONFIG.db.dbname ,

    ), &opt).await.unwrap();
}
//rbatis 数据库连接
lazy_static! {
    pub static ref RB:Rbatis=Rbatis::new();
 }